import type { IActivityListResData, IActivityRegister, IOrganizingUnit, registerType } from "@/api/activity/types";
import type { AppShareLogResult } from "@/api/indexTypes";
import type { IUserInfo } from "@/api/login/types";
import type { SignTypeEnum } from "@/enums/activityStatusEnum";
import type { FunctionArgs } from "@vueuse/core";
import type { SelectTicketType } from ".";
import type { ReturnWxShareOptions } from "@/components/CustomShare/types";

/**
 * 活动列表
 */
export type ActivityList = {
  /** 是否是我的活动 */
  isMyActivity?: undefined | 1;
};

/**
 * 活动详情
 */
export type ActivityDetails = {
  id: number;
  shareKey?: string
  scene?: number;
  /** 转增人的报名id */
  registerId?: number;
  refresh?: () => void;
};

export type RegistrationRecord = {
  isBuyTicket?: boolean,
  shareKey?: string
}

/**活动详情预览 */
export type ActivityDetailsPreview = {
  scene?: number;
  id: number;
};

export type SignUpInfoConfirm = {
  activityId: number
  registerType: registerType
  equipmentNumber?: string
  applicantInfo?: {
    phonenumber: IUserInfo['phonenumber'],
    companyName: IUserInfo['companyName'],
    companyPosition: IUserInfo['companyPosition']
    userName: IUserInfo['userName'],
    retinueId?: number
  }
  success: () => void
}

/** 报名情况 */
export type ApplicantsList = {
  activityId: number;
  displayRegister?: IActivityListResData['displayRegister']
};

/**
 * 代报名页
 */
// export type GmatPage = {
//   activityId: number;
//   memberOpen: memberOpen
//   callback: () => void;
// };

/**
 * 入场名单
 */
export type AdmissionList = {
  activityId: number;
  /** 已报名人数 */
  passedNum?: number
};

/** 扫描入场二维码 小程序码 参数 */
export type SignInPage = {
  scene: number;
  equipmentNumber: string
};

/**
 * 活动手签
 */
export type ActivitySign = {
  activityId: number;
  activityRegisterId?: number
  equipmentNumber?: string
  signType?: SignTypeEnum
  /** 返回签名图片的 临时地址与网络地址 */
  // success: (res: { tmpUrl: string; imgUrl: string }) => void;
};

/**
 * 报名审核中
 */
export type RegistrationUnderReview = {
  activityId: number;
  equipmentNumber?: string
};

/**
 * 参会证
 */
export type AttendanceCard = {
  activityId: number;
  equipmentNumber: string
  url?: string;
  activityRegisterId?: number;

  isActivityArrange?: boolean;
  attendanceCardUrl?: string;
};

export type SignInResult = {
  activityId: number;
  equipmentNumber: string
  url?: string;
  /** 有报名ID时, 表示已通过自主核销 */
  activityRegisterId?: number;
  signType?: SignTypeEnum
}

/** 添加随行人员 */
export type AddRetinue = {
  callback: FunctionArgs
}

export type ActivityScheduling = Partial<AppShareLogResult> & {
  sceneType?: 'attendanceCard' | 'order'
  activityId?: number;
  activityRegisterId?: number
  userId?: number
}
/**活动人员管理 */
export type ActivityPersonManage = {
  activityId: number;
  success: FunctionArgs
}

/**举办单位 */
export type OrganizingUnitList = {
  organizingUnitList: IOrganizingUnit[]
}

/**报名审核 */
export type SignUpDetail = {
  activityRegister: IActivityRegister,
  success: FunctionArgs
}

export type ActivityRegisterForm = {
  id: number
  activityId?: number
  type?: 'order' | 'registerDetail' | 'activityManage'
}

export type ActivityRegisterDetail = {
  registerId: number
  callback?: () => void;
}

export type ActivityManageRegisterDetail = {
  registerId: number
  callback?: () => void;
}

export type AdminSignedIt = {
  activityId: number
  activityTitle: string
}

export type SelfRegistration = {
  activityId: number
  equipmentNumber: string
}

export type ActivityResult = {
  orderCode?: string
  equipmentNumber?: string
}
/**
 * 申请审核列表
 */
export type ApplyForExamine = {
  activityId: number;
  success: FunctionArgs;
}
/**退票申请详情 */
export type RefundExamineDetail = {
  registerId: number;
  success: FunctionArgs;
}

/**浏览记录 */
export type ActivityBrowsingHistory = {
  activityId: number;
}
/**详细浏览记录 */
export type ActivityBrowsingHistoryDetail = {
  appUserInfoId: number;
  activityId: number;
  inviteAppUserInfoId?: number;
}

/**邀请排行 */
export type InvitationRanking = {
  activityId: number;
}
/**
 * 邀请排行详情
 */
export type InvitationRankingDetail = {
  activityId: number;
  appUserInfoId?: number
}

/**活动详情的邀请排行 */
export type ActivityDetailInvitationRanking = {
  activityId: number;
}
/**
 * 获得详情的邀请排行详情
 */
export type ActivityDetailInvitationRankingDetail = {
  activityId: number;
  appUserInfoId?: number
}

export type SignedOnBehalfOf = {
  success: FunctionArgs;
  registerId: number;
  activityId: number
}
/**
 * 大屏管理
 */
export type BigScreenManagement = {
  activityId: number
}

/**人脉广场 */
export type ConnectionSquare = {
  activityId: number;
  scene?: number;

}